package com.freewater.springboot.demo.spel.array;

import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        ExpressionParser parser = new SpelExpressionParser();
        final int[] numbers1 = (int[]) parser.parseExpression("new int[4]").getValue();
        System.out.println(Arrays.toString(numbers1));

        final int[] numbers2 = (int[]) parser.parseExpression("new int[]{1,2,3}").getValue();
        System.out.println(Arrays.toString(numbers2));

        final int[][] numbers = (int[][]) parser.parseExpression("new int[4][5]").getValue();
        System.out.println(Arrays.deepToString(numbers));
    }
}
